package com.kfm.jdbc.day0327;

import com.kfm.jdbc.day0327.entity.Account;

public class Demo03 {

    public static void main(String[] args) {
        // 获取 Class 对象
        Account account = new Account();
        Class<? extends Account> aClass = account.getClass();
        Class<Account> accountClass = Account.class;
        try {
            Class<?> aClass1 = Class.forName("com.kfm.jdbc.day0327.entity.Account");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }

        // 反射：运行时动态或去类的信息
        String name = aClass.getName();
        String packageName = aClass.getPackageName();
        String simpleName = aClass.getSimpleName();

        System.out.println(name);
        System.out.println(packageName);
        System.out.println(simpleName);
    }
}
